<html>
<head><meta charset="utf-8"><title>Allowing pattern-like `..` in `fn` args · t-lang · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/index.html">t-lang</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Allowing.20pattern-like.20.60.2E.2E.60.20in.20.60fn.60.20args.html">Allowing pattern-like `..` in `fn` args</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="232646058"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Allowing%20pattern-like%20%60..%60%20in%20%60fn%60%20args/near/232646058" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Allowing.20pattern-like.20.60.2E.2E.60.20in.20.60fn.60.20args.html#232646058">(Mar 31 2021 at 18:59)</a>:</h4>
<p><span class="user-mention silent" data-user-id="271719">Mario Carneiro</span> <a href="#narrow/stream/213817-t-lang/topic/warn.20on.20casting.20fn.20to.20non-usize.20integer.20.28edition.20change.3F.29/near/232607665">said</a>:</p>
<blockquote>
<p>Isn't this kind of verbose though? It would be great if this could be written <code>foo as fn(_) -&gt; _ as usize</code> but I don't think that syntax works</p>
</blockquote>
<p>This is an interesting point.  We have <code>Foo { .. }</code> in patterns to match multiple fields; could it makes sense to allow <code>fn(..) -&gt; _</code> as a way to match any function pointer type?  And similarly, <code>Fn(..) -&gt; _</code> for <code>Fn&lt;_, Output = _&gt;</code>?</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>